<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <base href="<%=basePath%>/">
    
    <title>系统用户管理</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link href="bootstrap/3/css/bootstrap.css" rel="stylesheet"/>
	<link href="css/common.css" rel="stylesheet" />

	<script src="scripts/jquery/jquery-1.7.min.js"></script>
	<script src="bootstrap/3/js/bootstrap.min.js"></script>
	<link href="bootstrap/3/css/datepicker.css" rel="stylesheet"/>
	<script src="bootstrap/3/js/bootstrap-datepicker.js"></script>
	
	<script src="index/js/index.js?" type="text/javascript"></script>
	
	<script type="text/javascript">
		var msg = "${msg}";
		if(msg!="")
			alert(msg);
	
		function del(id){
			if(confirm("确定删除吗？"))
				location.href="<%= basePath%>/${action}?method=delete&id="+id;
		}
		$(document).ready(function(){
			//
    	});
	</script>
	
	<style>
		body{
			margin-left: 10px;
			margin-top: 7px;
		}
		
	</style>
  </head>
  
  <body>
  	
	<div>
		<div class="alert-info" style="">
			<s:if test="#request.add>0">
				 <a href="${action}?method=add&flag=1" style="color:#fff;"  class="btn btn-success " >
					添加用户
				</a>
			</s:if>
			<div style="display:inline;margin-left:30px;color:#f00;">
				${msg }
			</div>
		</div >
	</div>
	
	
	<table class="table  table-hover" style="width:100%;">
  		
  		<tr>
  			<th class="hidden"> sysUserId</th>
  			<th >头像</th>
  			<th >用户名</th>
  			<th >真实姓名</th>
  			<th >角色</th>
  			<th class="hidden">简介</th>
  			<th >邮箱</th>
  			<th >最后登录时间</th>
  			<th >登录IP</th>
  			<th >状态</th>
  			<s:if test="#request.delete>0 || #request.update>0">
  				<th >操作</th>
  			</s:if>
  		</tr>
  
	   <s:iterator id="l"  value="list" status="index">  
			<tr>
				<td class="hidden">${sysUserId }</td>
				<td ><img src="${photo }" style="width:30px;height:30px;" default="images/user/default.gif" /></td>
				<td><s:property value="#l.userName" /> </td>
				<td><s:property value="#l.realName" /> </td>
				<td><s:property value="#l.roleName" /> </td>
				<td class="hidden"><s:property value="#l.introduction" /> </td>
				<td><s:property value="#l.email" /> </td>
				<td><s:property value="#l.loginTime" /> </td>
				<td><s:property value="#l.ip" /> </td>
				<td><s:property value="#l.statusName" /> </td>
				<s:if test="#request.delete>0 || #request.update>0">
					<td >
						<s:if test="#request.delete>0">
							<a class="btn btn-danger" href="javascript:del(${sysUserId})" title="删除">
								<span class="glyphicon glyphicon-trash"></span>
							</a>
						</s:if>
						<s:if test="#request.update>0">
							<a class="btn btn-info" href="${action }?method=update&id=${sysUserId}" title="修改">
								<span class="glyphicon glyphicon-edit"></span>
							</a>
						</s:if>
						<s:if test="#request.view>0 ">
	              	 		<a class="btn btn-success"  href="${action}?method=update&id=${roleId}" title="查看详情">
	              	 			<span class="glyphicon glyphicon-list-alt"></span>
	              	 		</a>
	              	 	</s:if>	
					</td>
				</s:if>
			</tr>
			
	  </s:iterator>
  	</table>
	
  </body>
</html>
